package com.carbon.system.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.carbon.system.entity.CarbonArticle;
import com.carbon.system.param.CarbonArticleQueryParam;
import com.carbon.system.param.CarbonArticleStatuParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 碳文章 Mapper 接口
 * </p>
 *
 * @author Li Jun
 * @since 2021-08-01
 */
@Repository
public interface CarbonArticleMapper extends BaseMapper<CarbonArticle> {

    IPage<CarbonArticle> search(Page<CarbonArticle> page, CarbonArticleQueryParam param);

    Boolean offlineOrUpdate(CarbonArticleStatuParam param);
    void saveFeishuDocInfo(@Param("article") CarbonArticle article);

    /**
     * 更新飞书文档内容（同步时用）
     */
    void updateFeishuDocContent(@Param("article") CarbonArticle article);

    /**
     * 根据业务文章 ID 查询飞书文档 URL
     */
     List<String> getFeishuDocUrl();
}
